package com.lin.manager.controller.order;


import com.lin.manager.aop.Log;
import com.lin.manager.common.enums.LogEnum;
import com.lin.manager.common.resp.R;
import com.lin.manager.order.model.PayVo;
import com.lin.manager.order.service.OrderPayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @作者: 林江
 * @创建时间: 2024-04-10 19:11:15
 * @功能:
 */
@Api(tags = "支付模块")
@RestController
@RequestMapping("order")
public class OrderPayController {

    @Autowired
    OrderPayService orderPayService;

    @ApiOperation("支付模块-支付订单")
    @Log(module = "支付模块", descipt = "支付订单", type = LogEnum.INSERT)
    @ApiImplicitParams(@ApiImplicitParam(name = "type", value = "1-支付宝，2-微信。。"))
    @PostMapping("/pay/{type}")
    public R orderPay(@PathVariable("type") Integer type, @RequestBody PayVo vo) {
        orderPayService.orderPay(type, vo);
        return R.ok();
    }
}
